package com.cityfood.common.pojo;

import java.io.Serializable;

/**
 * 
 */
public class CityFoodResult implements Serializable{
	
    /**
	 * 
	 */
	private static final long serialVersionUID = 5357097187152614503L;

	// 响应业务状态
    private Integer code;

    // 响应消息
    private String msg;

    // 响应中的数据
    private Object data;
    
    //构建其他状态的taotaoresult对象
    public static CityFoodResult build(Integer status, String msg, Object data) {
    	return new CityFoodResult(status, msg, data);
    }

    public static CityFoodResult ok(Object data) {
        return new CityFoodResult(data);
    }

    public static CityFoodResult ok() {
        return new CityFoodResult(null);
    }

    public CityFoodResult() {

    }

    public static CityFoodResult build(Integer status, String msg) {
        return new CityFoodResult(status, msg, null);
    }

    public CityFoodResult(Integer status, String msg, Object data) {
        this.code = status;
        this.msg = msg;
        this.data = data;
    }

    public CityFoodResult(Object data) {
        this.code = 200;
        this.msg = "OK";
        this.data = data;
    }

    public Integer getCode() {
		return code;
	}

	public void setCode(Integer code) {
		this.code = code;
	}

	public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

}
